This is a parallel version of the expansion. Each expansion is positioned in distance apart, and transposed to start at a symbol which appears on that position in the template pattern. If there are multiple expansions they are taken one of a time, and restarted when necessary. The results have great variety and look promising for the purpose of generating melodies and tonality zones for experimental music. See more examples on the manual.
(def-grammar 'mel1
a (a b c)
b (c a g)
)
(setq seedform (gen-trans a 5 'mel1))
(gen-expansion-parallel 10 seedform
(list seedform
(symbol-inversion 'a seedform)))
Fractal Tonalities
A general way of building tonality zones from symbol patterns is to symbol-mix many symbol patterns, and then use symbols-to-tonality to map the symbols onto a scale.
(setq symbols
(symbol-mix
(gen-expansion 4 '(a b a) '(a b a))
(gen-expansion 4 '(a c a) '(a c a))
(gen-expansion 4 '(a d a) '(a d a))))
(setq chords
(symbols-to-tonality
symbols symbols
transpose '((0))
mapping (activate-tonality (blues1 c 3))
)
)
Geometrical Progressions
(setq symbols
(gen-expansion-parallel 4
(symbol-repeat 6 '(a b c b c d c d e d e f e f g))
(list '(a b c d c b a)
(symbol-inversion 'a '(a b c d c b a)))))
(setq symbols
(gen-expansion-parallel 3
(symbol-repeat 10 '(a b c b c d c d e d e f e f g))
(list '(a b c d c b a)
(symbol-inversion 'a '(a b c d c b a)))))
(gen-expansion-parallel 3
(flatten (cons-n '(a b c b c d c d e d e f e f g) 10))
(list '(a b c d c b a)
(symbol-inversion 'a '(a b c d c b a))))
Random Progressions
(gen-expansion-parallel 4
(flatten (cons-n '(a b c b c d c d e d e f e f g) 10))
(list (setq mat (gen-random nil 7 '(a b c d e)))
(symbol-inversion 'a mat)))
(gen-expansion-parallel 4
(flatten (cons-n (gen-random nil 20 '(a b c d e)) 10))
(list (setq mat (gen-random nil 7 '(a b c d e)))
(symbol-inversion 'a mat)))
Wave-like Patterns
(gen-expansion-parallel 4
(flatten (cons-n (gen-random nil 20 '(a b c d e)) 10))